package com.iwomy.secureplat.platform.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.iwomy.secureplat.common.core.util.R;
import com.iwomy.secureplat.common.data.datascope.DataScope;
import com.iwomy.secureplat.platform.dto.BasicDeviceDTO;
import com.iwomy.secureplat.platform.dto.BasicInventoryDeviceDTO;
import com.iwomy.secureplat.platform.entity.BasicDeviceEntity;
import com.iwomy.secureplat.platform.entity.BasicDeviceModelEntity;
import com.iwomy.secureplat.platform.entity.DeviceEventReportEntity;
import com.iwomy.secureplat.platform.vo.BasicDeviceExcelVO;
import com.iwomy.secureplat.platform.vo.BasicDeviceVO;
import com.iwomy.secureplat.platform.vo.DeviceInventoryListVO;
import com.iwomy.secureplat.platform.vo.ProductRotationVO;
import org.springframework.validation.BindingResult;

import java.util.List;

public interface BasicDeviceService extends IService<BasicDeviceEntity> {

	Page<BasicDeviceVO> getBasicDevicePage(Page page, BasicDeviceDTO basicDeviceDTO);

	BasicDeviceVO getByIds(Long id);

	R importDevice(List<BasicDeviceExcelVO> excelVOList, BindingResult bindingResult,Long parentId);


	/**
	 * 分页
	 *
	 * @param page
	 * @return
	 */
	Page<BasicInventoryDeviceDTO> pageList(Page page, BasicDeviceDTO basicDeviceDTO);

	DeviceInventoryListVO getDeviceInventoryList(Long id);

	List<BasicDeviceVO> listByScope(BasicDeviceDTO basicDeviceEntity);

	BasicDeviceEntity getByImei(String imei);

	BasicDeviceEntity getHistoricalImei(String imei);

	Long getDeviceOnlineCount();

	Long getDeviceOfflineCount();

	Long getDeviceNormalCount();

	Long getDeviceFaultCount();

	Long getDeviceAlarmCount();

	/**
	 * 统计设备状态
	 *
	 * @return
	 */
	List<DeviceEventReportEntity> deviceEventReport();

	/**
	 * 首页轮播图
	 * @return
	 */
	List<ProductRotationVO> productRotation();

    List<BasicDeviceEntity> listByScope(LambdaQueryWrapper<BasicDeviceEntity> queryWrapper, DataScope dataScope);


    List<BasicDeviceModelEntity> homeGetModelListByDevice();

	List<BasicDeviceVO> getdeviceList(BasicDeviceDTO basicDeviceDTO);


	List<BasicDeviceEntity> allModel( );


	void deactivateDevice( BasicDeviceEntity basicDevice);

}